﻿using System;
using System.Collections;
using System.Collections.Generic;
using Adaptive.Foundation.Tokenizers;

namespace Adaptive.Foundation.Parsing
{
    /// <summary>
    /// Provides a marker definition for classes which perform parsing tasks
    /// using rules.
    /// </summary>
    public interface IParser
    {
    }
    /// <summary>
    /// Provides a signature definition for classes which perform parsing tasks
    /// using rules.
    /// </summary>
    public interface IParser<T>
    {
        /*--------------------------------------------------------------------------------
         * Methods / Functions
         *------------------------------------------------------------------------------*/
        #region Methods / Functions
        /// <summary>
        /// Parses the supplied token list into the return object.
        /// </summary>
        /// <param name="tokenList">
        /// A list of tokens to be processed.
        /// </param>
        /// <returns>
        /// An instance rendered from the token data.
        /// </returns>
        T Parse(RawTokenCollection tokenList);
        /// <summary>
        /// Parses the lists of tokens into thier appropriate object instances.
        /// </summary>
        /// <param name="listOfTokenLists">
        /// A list of lists of tokens to be processed.
        /// </param>
        /// <returns>
        /// A list of  object instances rendered from the token data.
        /// </returns>
        List<T> Parse(List<RawTokenCollection> listOfTokenLists);
        #endregion
    }
}